import { request, upload } from '@/utils/request'
const BASEURL = process.env.VUE_APP_BASE_API
// 新客户
export function newCustomerList(data) {
  return request({
    url: '/my/customer/new/page',
    method: 'post',
    data
  })
}
// 客户字段
export function customerFieldList(data) {
  return request({
    url: '/customer/field/list',
    method: 'post',
    data
  })
}
// 添加客户
export function addCustomer(data) {
  return request({
    url: '/my/customer/add',
    method: 'post',
    data
  })
}
// 编辑客户
export function updateCustomer(data) {
  return request({
    url: '/my/customer/update',
    method: 'post',
    data
  })
}
// 取消协助
export function cancleHelp(data) {
  return request({
    url: '/my/customer/help/cancel',
    method: 'post',
    data
  })
}
// 员工列表
export function employeeList(data) {
  return request({
    url: '/employee/list',
    method: 'post',
    data
  })
}
// 协助
export function helpCustomer(data) {
  return request({
    url: '/my/customer/help',
    method: 'post',
    data
  })
}
// 签约
export function customerContract(data) {
  return request({
    url: '/my/customer/contract',
    method: 'post',
    data
  })
}
// 签约作废
export function abolishCustomerContract(data) {
  return request({
    url: '/my/customer/contract/abolish',
    method: 'post',
    data
  })
}
// 上传文件
export function uploadFile(data, onUploadProgress) {
  return upload({
    url: '/upload',
    method: 'post',
    data,
    ContentType: 'multipart/form-data',
    onUploadProgress(a) {
      onUploadProgress(a)
    }
  })
}

export const UPLOADFILEPATH = BASEURL + '/upload'

// 再分配客户
export function againCustomerList(data) {
  return request({
    url: '/my/customer/again/page',
    method: 'post',
    data
  })
}
// 协助客户
export function helpCustomerList(data) {
  return request({
    url: '/my/customer/help/page',
    method: 'post',
    data
  })
}
// 我的全部客户
export function allCustomerList(data) {
  return request({
    url: '/my/customer/all/page',
    method: 'post',
    data
  })
}
// 全部客户
export function allCustomerPage(data) {
  return request({
    url: '/customer/all/page',
    method: 'post',
    data
  })
}
// 我的进件
export function importPage(data) {
  return request({
    url: '/import/page',
    method: 'post',
    data
  })
}
// 全部门店
export function shopList(data) {
  return request({
    url: '/shop/list',
    method: 'post',
    data
  })
}
// 全部团队
export function allTeamList(data) {
  return request({
    url: '/team/all',
    method: 'post',
    data
  })
}
// 全部员工
export function employeePage(data) {
  return request({
    url: '/employee/page',
    method: 'post',
    data
  })
}
// 分配
export function customerDistribute(data) {
  return request({
    url: '/customer/distribute?distribute=1',
    method: 'post',
    data
  })
}
// 公共池
export function customerPublicPage(data) {
  return request({
    url: '/customer/public/page',
    method: 'post',
    data
  })
}
// 待分配
export function customerWaitPage(data) {
  return request({
    url: '/customer/wait/page',
    method: 'post',
    data
  })
}
// 全部签约
export function customerAllContract(data) {
  return request({
    url: '/customer/contract',
    method: 'post',
    data
  })
}
// 加入公共池
export function addPool(data) {
  return request({
    url: '/my/customer/add/pool',
    method: 'post',
    data
  })
}
// 点评
export function customerComment(data) {
  return request({
    url: '/customer/comment',
    method: 'post',
    data
  })
}
// 查询客户
export function myCustomerAll(data) {
  return request({
    url: '/my/customer/all',
    method: 'post',
    data
  })
}
// 添加签约
export function addContract(data) {
  return request({
    url: '/my/customer/contract/add',
    method: 'post',
    data
  })
}
// 添加签约
export function updateContract(data) {
  return request({
    url: '/my/customer/contract/update',
    method: 'post',
    data
  })
}
// 查询签约
export function myContractAll(data) {
  return request({
    url: '/my/contract/all',
    method: 'post',
    data
  })
}
// 全部产品
export function productAll(data) {
  return request({
    url: '/product/all',
    method: 'post',
    data
  })
}
// 添加进件
export function addImport(data) {
  return request({
    url: '/import/add',
    method: 'post',
    data
  })
}
// 编辑进件
export function updateImport(data) {
  return request({
    url: '/import/update',
    method: 'post',
    data
  })
}
// 渠道客户
export function channelCustomer(data) {
  return request({
    url: '/channel/customer/page',
    method: 'post',
    data
  })
}

// 员工列表
export function getEmployee(data) {
  return request({
    url: `/employee/list?shopId=${data.shopId}&teamId=${data.teamId}`,
    method: 'post'
  })
}

//
export function call(data) {
  return request({
    url: `/my/customer/dial?customerId=${data.customerId}&mobile=${data.mobile}`,
    method: 'post'
  })
}

export function getRecordList(mobile) {
  return request({
    url: `/customer/voice?mobile=${mobile}`,
    method: 'post'
  })
}

// 获取客户状态
export const GETCUSTOMERSTATUS = (params) => {
  return request({
    url: '/customer/status',
    params
  })
}

// 跟进客户-保存客户资料
export const SAVECUSTOMERFILES = (params) => {
  return request({
    url: 'my/customer/save/file',
    data: params
  })
}

// 客户管理-全部进件客户-获取列表
export const GETIMPORTCUSTOMER = (params) => {
  return request({
    url: 'import/customer/page',
    data: params
  })
}

// 后端管理-我的客户
export const GETBEHINDMYCUSTOMERLIST = (params) => {
  return request({
    url: 'behind/my/page',
    data: params
  })
}

// 后端管理-待分配的客户
export const GETBEHINDWAITCUSTOMERLIST = (params) => {
  return request({
    url: 'behind/wait/page',
    data: params
  })
}

// 后端管理-待分配的客户-分配
export const CUSTOMERDISTRIBUTE = (params) => {
  return request({
    url: 'behind/dis',
    data: params
  })
}

// 后端管理-所有的客户
export const GETBEHINDALLCUSTOMERLIST = (params) => {
  return request({
    url: 'behind/all/page',
    data: params
  })
}

// 后端管理-所有的客户-更新产品进度
export const UPDATEPRODUCTPROCESS = (params) => {
  return request({
    url: 'behind/update/product/process',
    data: params
  })
}

// 后端管理-添加跟进记录
export const BEHINDADDREMARK = (params) => {
  return request({
    url: 'behind/add/remark',
    data: params
  })
}

// 获取 全部产品
export const GETALLPRODUCTLIST = (params) => {
  return request({
    url: '/product/all',
    data: params
  })
}


